package com.pyb.pojo;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.springframework.validation.annotation.Validated;
/**
 * @version 1.0
 * @Author 彭彦彬
 * @Date 2025/1/17 9:46
 * @注释
 */
@Data
@Validated
public class User {
    @Pattern(regexp = "^1([34578])\\d{9}$",message = "手机号码格式错误")
    private String number;
    @NotNull(message = "姓名不能为空")
    private String name;
    @Max(value = 150,message = "年龄太大")
    @Min(value = 0,message = "年龄不能为零")
    private int age;
}
